﻿<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title>CGU API 9.0102 - Crypto</title>
  <link rel="stylesheet" type="text/css" href="reset.css" />
  <link rel="stylesheet" type="text/css" href="main.css" />
</head>

<body>

<div id="head">
  <div id="title">
    <h1>CGU</h1>&nbsp;&nbsp;<h2>Common &amp; General Use JavaScript</h2>
  </div>
</div>

<div id="foot">
  <div id="copy">
    <span>&copy; 2008 CGU</span>
  </div>
</div>

<div id="body">
  <div id="nav">
    <div class="pad">
      
      <div class="navlist">
        <h3>CGU</h3>
        <ul>
          <li><a href="index.html">API Home</a></li>
          <li><a href="functions.html">Functions</a></li>
        </ul>
      </div>

      <div class="navlist">
        <h3>Crypto</h3>
        <ul>
          <li><a href="functions.hash.html">hash</a></li>
          <li><a href="functions.hashes.html">hashes</a></li>
        </ul>
      </div>

      <div class="navlist">
        <h3>Utilities</h3>
        <ul>
          <li><a href="utilities.Cookie.html">Cookie</a></li>
          <li class="active"><a href="utilities.Crypto.html">Crypto</a></li>
          <li><a href="utilities.Iterator.html">Iterator</a></li>
          <li><a href="utilities.JSON.html">JSON</a></li>
          <li><a href="utilities.Query.html">Query</a></li>
          <li><a href="utilities.Time.html">Time</a></li>
          <li><a href="utilities.Type.html">Type</a></li>
        </ul>
      </div>
      
    </div>
  </div>
  
  <div id="docs">
    <div class="pad">
      <div id="content">

<h1 id='CGU-Main'>Crypto</h1>

<blockquote>
<p>Crypto adds <a href='http://wikipedia.org/wiki/Cryptographic_hash_function'>cryptographic hash functions</a> to JavaScript.</p>

<p>It&#8217;s designed to be simple to use, allowing 1-way and HMAC hashing through the use of a single function.</p>
</blockquote>
<hr />
<h3 id='functions'>Functions</h3>

<h4 id='func-hash'><a href='functions.hash.html'>hash</a></h4>

<blockquote>
<p>Generate a cryptographic hash of given data.</p>
</blockquote>

<h4 id='func-hashes'><a href='functions.hashes.html'>hashes</a></h4>

<blockquote>
<p>Get a list of all available algorithms.</p>
</blockquote>
<hr />
<h3 id='encoding'>Encoding</h3>

<blockquote>
<p>Base-16, Base-32, and Base-64 are based on <a href='http://www.ietf.org/rfc/rfc4648.txt'>RFC 4648</a>.</p>
</blockquote>

<h4 id='encoding-base16'>Base-16</h4>

<blockquote>
<h5 id='encode-base16'><code>base16</code></h5>

<blockquote>
<p>Uppercase hexadecimal <code>(0-9 A-F)</code>.</p>
</blockquote>
</blockquote>

<blockquote>
<h5 id='encode-hex'><code>hex</code></h5>

<blockquote>
<p>Lowercase hexadecimal <code>(0-9 a-f)</code>.</p>
</blockquote>
</blockquote>

<h4 id='encoding-base32'>Base-32</h4>

<blockquote>
<h5 id='encode-base32'><code>base32</code></h5>

<blockquote>
<p>Standard Base-32 <code>(A-Z 2-7)</code>.</p>
</blockquote>
</blockquote>

<blockquote>
<h5 id='encode-base32hex'><code>base32hex</code></h5>

<blockquote>
<p>Hexadecimal Base-32 <code>(0-9 a-v)</code>.</p>
</blockquote>
</blockquote>

<h4 id='encoding-base64'>Base-64</h4>

<blockquote>
<h5 id='encode-base64'><code>base64</code></h5>

<blockquote>
<p>Standard Base-64 <code>(A-Z a-z 0-9 + /)</code>.</p>
</blockquote>
</blockquote>

<blockquote>
<h5 id='encode-base64url'><code>base64url</code></h5>

<blockquote>
<p>URL Alternative <code>(A-Z a-z 0-9 - _)</code>.</p>
</blockquote>
</blockquote>

<h4 id='encoding-other'>Other</h4>

<blockquote>
<h5 id='encode-raw'><code>raw</code></h5>

<blockquote>
<p>Returns a byte array of the hash <code>(e.g., [0x00, 0xff, ...])</code>.</p>
</blockquote>
</blockquote>

<blockquote>
<h5 id='encode-str'><code>str</code></h5>

<blockquote>
<p>Returns an 8-bit encoded string via <code>String.fromCharCode</code>.</p>
</blockquote>
</blockquote>
<hr />

      </div>
    </div>
  </div>
</div>

  <script type="text/javascript" src="prettify.js"></script>
  <script type="text/javascript" src="main.js"></script>
</body>

</html>
